var token = localStorage.getItem("token"),
    userData = Sendajax("http://119.23.46.241:8080/login/personalpage/selpersonalinfo", "post", '', token);

if (token) {
    //上次登录时间
    $(".lastLoginTime p:nth-child(2)").text(localStorage.getItem("updateTime"))
    //用户信息
    $(".personal-information").html(`<section class="personal-information-detailed">
    <!-- 用户名 -->
    <section class="username">${userData.data.username + '（' + userData.data.name + '）'}</section>
    <!--用户权限-->
    <section class="jurisdiction">${userData.data.type}</section>
    <!-- 用户ID -->
    <section class="user-id">ID：${userData.data.id}</section>
</section>
    <!-- 用户头像 -->
<section class="head-portrait"></section>`)
    if (userData.data.headImg) {
        $(".head-portrait").html(`<img src="${userData.data.headImg}" alt="">`)
    } else {
        $(".head-portrait").html(`<p>${userData.data.name.substr(-2)}</p>`)
    }
}


$(".exit").on("click", function () {
    stop()
    let tip = layer.confirm('确定退出', {
        btn: ['确定', '取消']
        , btn1: function (index, layero) {
            layer.close(tip)
            move()
            window.location.href = 'userLoginPage.html'
        }, btn2: function (index, layero) {
            layer.close(tip)
            move()
        },title: '提示'
    });
})

$(".release-fina-results,.release-dormitory-results").on("click", function () {
    $("#footer").after(`<section class="jump-box">
    <section>
        <section class="jump-box-header">
            <p>请移步到网页的PC端上传文件吧</p>
            <p>下方是PC端的IP地址</p>
        </section>
        <section class="jump-box-content">
            <p>119.23.46.241</p>
        </section>
        <section class="jump-box-footer"><p>有问题？联系我们：</p>
            <p>yjxst@icloud.com</p></section>
    </section>
</section>`)
    stop()
    $(".jump-box").on("click", function () {
        $(this).remove()
        move()
    })
})

$(".browsing-history").on("click", function () {
    stop()
    let tip = layer.confirm('抱歉！功能暂未开发', {
        btn: ['确定']
        , btn1: function (index, layero) {
            layer.close(tip)
            move()
        }, title: '提示'
    });
})